#ifndef GRID_H
#define GRID_H

#include "astar.h"

#include <list>

/* Grid
 *
 * Serves as a wrapper for nodes in the Astar maps.
 *
 * By: M. Etheredge
 *     S. Brattinga
 */

#include <stdio.h>

using namespace std;

class Grid
{
private:
	int m_Width;
	int m_Height;

	list<Astar::Node*> m_Path;
	vector<Astar::Node*> m_NodesList;

	Astar::Node *m_Goal;
	Astar::Node *m_End;
public:
	Grid( int p_Width, int p_Height );
	virtual ~Grid();

	void SetGoal( Astar::Node *p_Goal ) { m_Goal = p_Goal; }
	void SetEnd( Astar::Node *p_End ) { m_End = p_End; }
	void SetGoal( const int p_X, const int p_Y );
	void SetEnd( const int p_X, const int p_Y );

	void Render( void );

	void BuildList( void );

	void BuildPath( void ) { m_Path = Astar::Astar( m_Goal, m_End ); }
};

#endif
